/*
 * \brief  Server-side timer session interface
 * \author Norman Feske
 * \date   2006-08-15
 */

/*
 * Copyright (C) 2006-2009 Norman Feske
 * Genode Labs, Feske & Helmuth Systementwicklung GbR
 *
 * This file is part of the Genode OS framework, which is distributed
 * under the terms of the GNU General Public License version 2.
 */

#ifndef _INCLUDE__TIMER_SESSION__SERVER_H_
#define _INCLUDE__TIMER_SESSION__SERVER_H_

#include <timer_session/timer_session.h>
#include <base/server.h>

namespace Timer {

	class Session_server : public Genode::Server_object, public Session
	{
		public:

			int dispatch(int op, Genode::Ipc_istream &is, Genode::Ipc_ostream &os)
			{
				switch (op) {

				case MSLEEP:
					{
						unsigned ms = 0;
						is >> ms;
						msleep(ms);
						return 0;
					}

				default:

					return -1;
				}
			}
	};
}

#endif /* _INCLUDE__TIMER_SESSION__SERVER_H_ */
